package com.hugboy.string;

import java.util.Scanner;

public class Demo7substring {
    public static void main(String[] args) {
        // 0~N
        String str = "itheima";
        String newStr = str.substring(2);
        System.out.println(newStr);

        // a~b
        String newStr2 = str.substring(2, 5);
        System.out.println(newStr2);

        // tel
        System.out.println("phone:");
        Scanner sc = new Scanner(System.in);
        String telStr = sc.nextLine();
        System.out.println("hidden phone:");
        System.out.println(telStr.substring(0, 3)+"****"+telStr.substring(7));


    }
}
